package cn.bonoon.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import cn.bonoon.kernel.support.entities.AbstractPersistable;

/**
 * 通用的标签的定义,标签在任何时候被引用,都会自增长,并记录下最后使用的时间
 * 
 * @author jackson
 * 
 */
@Entity
@Table(name = "t_tag")
public class TagEntity extends AbstractPersistable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -3179698184236262716L;
	/**
	 * 标签名,标签名不能太长,定义在20个字符内
	 */
	@Column(name = "C_TAGNAME", length = 20)
	private String tagName;
	/**
	 * 总共被引用的次数
	 */
	@Column(name = "C_COUNT")
	private int count;
	/**
	 * 创建的时间
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "C_CREATEAT", nullable = false)
	private Date createAt;
	/**
	 * 最后一次引用的时间
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "C_LASTQUOTEAT", nullable = false)
	private Date lastQuoteAt;

	public String getTagName() {
		return tagName;
	}

	public void setTagName(String tagName) {
		this.tagName = tagName;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public Date getCreateAt() {
		return createAt;
	}

	public void setCreateAt(Date createAt) {
		this.createAt = createAt;
	}

	public Date getLastQuoteAt() {
		return lastQuoteAt;
	}

	public void setLastQuoteAt(Date lastQuoteAt) {
		this.lastQuoteAt = lastQuoteAt;
	}
}
